@import (once) "../../include/vars";
@import (once) "../../include/mixins";

.img-container, .img-fluid, .img-thumbnail {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    position: relative;
    vertical-align: middle;
    background-color: @transparent;
    transition: @transition-base;
    overflow: visible;
}

.img-thumbnail {
    padding: .25rem;
    border: 1px solid @borderColor;
    border-radius: @borderRadius;
    background-color: @white;
}

.img-container {
    display: block;

    img {
        width: 100%;
        max-width: 100%;
        height: auto;
        position: relative;
    }

    .image-overlay {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        opacity: 0;
        overflow: hidden;
        font-size: .875rem;
        line-height: 1rem;
        padding: 2em;
        background-color: rgba(red(@cyan), green(@cyan), blue(@cyan), .7);
        color: @white;
        text-align: center;
        border-radius: inherit;
        transition: @transition-base;

        * {
            color: @white;
        }

        &:hover {
            opacity: 1;

            &:before, &:after {
                opacity: 1;
                transform: scale(1);
            }
        }

        &:before, &:after {
            display: block;
            position: absolute;
            content: "";
            border: 1px solid rgba(255, 255, 255, 0.7);
            top: 1em;
            bottom: 1em;
            left: 1em;
            right: 1em;
            opacity: 0;
            border-radius: inherit;

            transform: scale(1.5);
            transition: @transition-base;
        }

        &:after {
            border-left: none;
            border-right: none;
            bottom: 1em;
            top: 1em;
        }
        &:before {
            border-top: none;
            border-bottom: none;
            bottom: 1em;
            top: 1em;
        }
    }

    &.rounded {
        img {
            border-radius: @borderRadius;
        }
    }

    &.thumbnail {
        padding: .25rem;
        border: 1px solid @borderColor;
        //border-radius: @borderRadius;
        background-color: @white;

        .title {
            font-size: .9rem;
            line-height: 1;
        }
    }

    img + .title {
        margin-top: .25rem;
    }

    .title + img {
        margin-top: .25rem;
    }

    &.cover {
        background-size: cover;
        background: no-repeat 100% 100%;
    }
}

figure {
    margin: 0 0 1rem;

    img {
        width: 100%;
        max-width: 100%;
        height: auto;
        display: block;
        position: relative;
        vertical-align: middle;
        background-color: @transparent;
        transition: @transition-base;
    }
}

.use-blur-image img:not([alt]) {
    filter: blur(8px);
}

// IE 10, 11
@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {
    .img-fluid {
        width: 100% \9;
    }

    .img-container {
        img {
            width: 100% \9;
        }
    }
}
